home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Garbo
/
Garbo.cdr
/
mac
/
hypercrd
/
hc1_2_x
/
fretext1.sit
/
Free Text Browser v1.01
/
background_2734.txt
< prev
next >
Wrap
Text File
|
1990-04-13
|
34KB
|
1,340 lines
-- background: 2734 from stack: in.01
-- bmap block id: 3197
-- flags: 0000
-- background id: 0
-- name: BrowserBg
----- HyperTalk script -----
on openCard -- make sure subset buttons are right for this card
put getSubsetHandle(1) = 0 or getSubsetHandle(1) = empty into noSub1
put getSubsetHandle(2) = 0 or getSubsetHandle(2) = empty into noSub2
if noSub1 and noSub2 then -- no subsets active on this card
hide bg button "and subsets"
hide bg button "or subsets"
hide bg button "not subset 1"
hide bg button "not subset 2"
hide bg button "fill subset 1"
hide bg button "fill subset 2"
else if noSub1 then -- only subset 2 active on this card
hide bg button "and subsets"
hide bg button "or subsets"
hide bg button "not subset 1"
hide bg button "fill subset 1"
show bg button "fill subset 2"
show bg button "not subset 2"
else if noSub2 then -- only subset 1 active on this card
hide bg button "and subsets"
hide bg button "or subsets"
hide bg button "not subset 2"
hide bg button "fill subset 2"
show bg button "fill subset 1"
show bg button "not subset 1"
else -- both subsets 1 and 2 active on this card
show bg button "fill subset 1"
show bg button "fill subset 2"
show bg button "not subset 1"
show bg button "not subset 2"
show bg button "or subsets"
show bg button "and subsets"
end if
end openCard
on closeCard -- tidy up when leaving...
if the height of field "Text" > 169 then
send mouseUp to bg button id 44
end if
hide field "searchPattern1"
hide field "searchPattern2"
end closeCard
-- part 15 (button)
-- low flags: 00
-- high flags: 0000
-- rect: left=233 top=0 right=22 bottom=255
-- title width / last selected line: 0
-- icon id / first selected line: 29514 / 29514
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: empty subset 1
----- HyperTalk script -----
on mouseUp
if the OptionKey is down then
show field "SearchPattern1"
else if the CommandKey is down then
ask "Proximity range (bytes)?" with 48
setNeighborhoodSize It -- reset neighborhood for proximity search
else -- empty the subset associated with Index field #1
checkOpenDatabase
if not (getSubsetHandle(1) = 0 or getSubsetHandle(1) = empty) then
get zbrowser ("RELEASESUBSET", getSubsetHandle(1))
end if
setSubsetHandle 1,zbrowser("NEWSUBSET",getTextFileRefNum())
get zbrowser ("EMPTYSUBSET", getSubsetHandle(1))
browseIndex1
put empty into field "SearchPattern1"
show field "SearchPattern1"
show bg button "fill subset 1"
show bg button "not subset 1"
if the visible of bg button "fill subset 2" then
show bg button "or subsets"
show bg button "and subsets"
end if
end if
end mouseUp
-- part 20 (button)
-- low flags: 00
-- high flags: 0000
-- rect: left=257 top=0 right=22 bottom=279
-- title width / last selected line: 0
-- icon id / first selected line: 29514 / 29514
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: empty subset 2
----- HyperTalk script -----
on mouseUp
if the OptionKey is down then
show field "SearchPattern2"
else if the CommandKey is down then
ask "Proximity range (bytes)?" with 48
setNeighborhoodSize It -- reset neighborhood for proximity search
else -- empty the subset associated with Index field #2
checkOpenDatabase
if not (getSubsetHandle(2) = 0 or getSubsetHandle(2) = empty) then
get zbrowser ("RELEASESUBSET", getSubsetHandle(2))
end if
setSubsetHandle 2,zbrowser("NEWSUBSET",getTextFileRefNum())
get zbrowser ("EMPTYSUBSET", getSubsetHandle(2))
browseIndex2
put empty into field "SearchPattern2"
show field "SearchPattern2"
show bg button "fill subset 2"
show bg button "not subset 2"
if the visible of bg button "fill subset 1" then
show bg button "or subsets"
show bg button "and subsets"
end if
end if
end mouseUp
-- part 39 (button)
-- low flags: 00
-- high flags: 2002
-- rect: left=493 top=157 right=177 bottom=512
-- title width / last selected line: 0
-- icon id / first selected line: 22489 / 22489
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: pageDownContext
----- HyperTalk script -----
on mouseDown
global contextLines
checkOpenDatabase
if line contextLines of field Context is empty then exit mouseDown
setInstanceNum getTextPtrListInstanceItem (contextLines)
browseContext 1
setInstanceNum getTextPtrListInstanceItem (1)
end mouseDown
on mouseStillDown
global contextLines
if line contextLines of field Context is empty then exit mouseStillDown
setInstanceNum getTextPtrListInstanceItem (contextLines)
browseContext 1
setInstanceNum getTextPtrListInstanceItem (1)
end mouseStillDown
-- part 38 (button)
-- low flags: 00
-- high flags: 2002
-- rect: left=493 top=119 right=143 bottom=512
-- title width / last selected line: 0
-- icon id / first selected line: 22489 / 22489
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: pageUpContext
----- HyperTalk script -----
on mouseDown
global contextLines
checkOpenDatabase
if line 1 of field Context is empty then exit mouseDown
browseContext contextLines
setInstanceNum getTextPtrListInstanceItem (1)
end mouseDown
on mouseStillDown
global contextLines
if line 1 of field Context is empty then exit mouseStillDown
browseContext contextLines
setInstanceNum getTextPtrListInstanceItem (1)
end mouseStillDown
-- part 33 (button)
-- low flags: 00
-- high flags: 2002
-- rect: left=213 top=71 right=90 bottom=233
-- title width / last selected line: 0
-- icon id / first selected line: 22489 / 22489
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: pageDownIndex1
----- HyperTalk script -----
on mouseDown
global indexLines
checkOpenDatabase
if line indexLines of field index1 is empty then
beep
exit mouseDown
end if
setWordNum1 (getWordNum1() + indexLines - 1)
browseIndex1
end mouseDown
on mouseStillDown
global indexLines
if line indexLines of field index1 is empty then
beep
exit mouseStillDown
end if
setWordNum1 (getWordNum1() + indexLines - 1)
browseIndex1
end mouseStillDown
-- part 25 (button)
-- low flags: 00
-- high flags: 2002
-- rect: left=213 top=34 right=57 bottom=233
-- title width / last selected line: 0
-- icon id / first selected line: 22489 / 22489
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: pageUpIndex1
----- HyperTalk script -----
on mouseDown
global indexLines
checkOpenDatabase
get getWordNum1() - indexLines + 1
if It < 0 then
beep
put 0 into It
end if
setWordNum1 It
browseIndex1
end mouseDown
on mouseStillDown
global indexLines
get getWordNum1() - indexLines + 1
if It < 0 then
beep
put 0 into It
end if
setWordNum1 It
browseIndex1
end mouseStillDown
-- part 35 (button)
-- low flags: 00
-- high flags: 2002
-- rect: left=492 top=34 right=57 bottom=512
-- title width / last selected line: 0
-- icon id / first selected line: 22489 / 22489
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: pageUpIndex2
----- HyperTalk script -----
on mouseDown
global indexLines
checkOpenDatabase
get getWordNum2() - indexLines + 1
if It < 0 then
beep
put 0 into It
end if
setWordNum2 It
browseIndex2
end mouseDown
on mouseStillDown
global indexLines
get getWordNum2() - indexLines + 1
if It < 0 then
beep
put 0 into It
end if
setWordNum2 It
browseIndex2
end mouseStillDown
-- part 36 (button)
-- low flags: 00
-- high flags: 2002
-- rect: left=493 top=71 right=90 bottom=512
-- title width / last selected line: 0
-- icon id / first selected line: 22489 / 22489
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: pageDownIndex2
----- HyperTalk script -----
on mouseDown
global indexLines
checkOpenDatabase
if line indexLines of field index2 is empty then
beep
exit mouseDown
end if
setWordNum2 (getWordNum2() + indexLines - 1)
browseIndex2
end mouseDown
on mouseStillDown
global indexLines
if line indexLines of field index2 is empty then
beep
exit mouseStillDown
end if
setWordNum2 (getWordNum2() + indexLines - 1)
browseIndex2
end mouseStillDown
-- part 31 (button)
-- low flags: 00
-- high flags: 2002
-- rect: left=495 top=88 right=104 bottom=512
-- title width / last selected line: 0
-- icon id / first selected line: 20407 / 20407
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: scrollDownIndex2
----- HyperTalk script -----
on mouseDown
global indexLines
checkOpenDatabase
if line indexLines of field Index2 is empty then
beep
exit mouseDown
end if
setWordNum2 (getWordNum2() + 1)
browseIndex2
end mouseDown
on mouseStillDown
global indexLines
if line indexLines of field Index2 is empty then
beep
exit mouseStillDown
end if
setWordNum2 (getWordNum2() + 2)
browseIndex2
end mouseStillDown
-- part 32 (button)
-- low flags: 00
-- high flags: 2002
-- rect: left=496 top=56 right=72 bottom=512
-- title width / last selected line: 0
-- icon id / first selected line: 15717 / 15717
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: jumpIndex2
----- HyperTalk script -----
on mouseUp
checkOpenDatabase
ask "Word to jump to?"
if It is empty then exit to HyperCard
lock screen
setWordNum2 (line 1 of zbrowser ("LOCATE", It, getKeyFileRefNum()))
if getWordNum2() < 0 then setWordNum2(0)
browseIndex2
end mouseUp
-- part 30 (button)
-- low flags: 00
-- high flags: 2002
-- rect: left=495 top=19 right=35 bottom=512
-- title width / last selected line: 0
-- icon id / first selected line: 24019 / 24019
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: scrollUpIndex2
----- HyperTalk script -----
on mouseDown
checkOpenDatabase
get getWordNum2() - 1
if It < 0 then
beep
put 0 into It
end if
setWordNum2 It
browseIndex2
end mouseDown
on mouseStillDown
get getWordNum2() - 2
if It < 0 then
beep
put 0 into It
end if
setWordNum2 It
browseIndex2
end mouseStillDown
-- part 34 (button)
-- low flags: 00
-- high flags: 2002
-- rect: left=216 top=19 right=35 bottom=233
-- title width / last selected line: 0
-- icon id / first selected line: 24019 / 24019
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: scrollUpIndex1
----- HyperTalk script -----
on mouseDown
checkOpenDatabase
get getWordNum1() - 1
if It < 0 then
beep
put 0 into It
end if
setWordNum1 It
browseIndex1
end mouseDown
on mouseStillDown
get getWordNum1() - 2
if It < 0 then
beep
put 0 into It
end if
setWordNum1 It
browseIndex1
end mouseStillDown
-- part 12 (button)
-- low flags: 00
-- high flags: 2002
-- rect: left=217 top=56 right=72 bottom=233
-- title width / last selected line: 0
-- icon id / first selected line: 15717 / 15717
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: jumpIndex1
----- HyperTalk script -----
on mouseUp
checkOpenDatabase
ask "Word to jump to?"
if It is empty then exit to HyperCard
lock screen
setWordNum1 (line 1 of zbrowser ("LOCATE", It, getKeyFileRefNum()))
if getWordNum1() < 0 then setWordNum1(0)
browseIndex1
end mouseUp
-- part 3 (field)
-- low flags: 01
-- high flags: 0002
-- rect: left=279 top=19 right=104 bottom=496
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 4
-- text size: 9
-- style flags: 0
-- line height: 12
-- part name: Index2
----- HyperTalk script -----
on mouseUp
global whichSubset
put ShiftKey() into shifty
put OptionKey() into opty
checkOpenDatabase -- make sure files are open
set cursor to watch
lock screen
put clickedLineNum() into clickedLine
if shifty is down and getSubsetHandle(2) is not 0 then
-- must add or subtract word from subset
show field "SearchPattern2"
if opty is down then -- subtract the word
put " and not " & last word of line clickedLine of field "Index2" after field "SearchPattern2"
get zbrowser ("SETSUBSETBITS", clickedLine + getWordNum2() - 1, getNeighborhoodSize(), 0, getKeyFileRefNum(), getPtrFileRefNum(), getSubsetHandle(2))
else -- add the word
if field "SearchPattern2" is not empty then
put " or " after field "searchPattern2"
end if
put last word of line clickedLine of field "Index2" after field "SearchPattern2"
get zbrowser ("SETSUBSETBITS", clickedLine + getWordNum2() - 1, getNeighborhoodSize(), 1, getKeyFileRefNum(), getPtrFileRefNum(), getSubsetHandle(2))
end if
browseIndex2
else
--must retrieve clicked word
put getInstanceList2item (clickedLine) into instanceNum
if instanceNum is empty then
beep
answer "Sorry, nothing to retrieve!"
exit to HyperCard
end if
setInstanceNum instanceNum
put 2 into whichSubset
browseContext 1
end if
end mouseUp
-- part 1 (field)
-- low flags: 01
-- high flags: 0002
-- rect: left=0 top=19 right=104 bottom=217
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 4
-- text size: 9
-- style flags: 0
-- line height: 12
-- part name: Index1
----- HyperTalk script -----
on mouseUp
global whichSubset
put ShiftKey() into shifty
put OptionKey() into opty
checkOpenDatabase -- make sure files are open
set cursor to watch
lock screen
put clickedLineNum() into clickedLine
if shifty is down and getSubsetHandle(1) is not 0 then
-- must add or subtract word from subset
show field "SearchPattern1"
if opty is down then -- subtract the word
put " and not " & last word of line clickedLine of field "Index1" after field "SearchPattern1"
get zbrowser ("SETSUBSETBITS", clickedLine + getWordNum1() - 1, getNeighborhoodSize(), 0, getKeyFileRefNum(), getPtrFileRefNum(), getSubsetHandle(1))
else -- add the word
if field "SearchPattern1" is not empty then
put " or " after field "searchPattern1"
end if
put last word of line clickedLine of field "Index1" after field "SearchPattern1"
get zbrowser ("SETSUBSETBITS", clickedLine + getWordNum1() - 1, getNeighborhoodSize(), 1, getKeyFileRefNum(), getPtrFileRefNum(), getSubsetHandle(1))
end if
browseIndex1
else
--must retrieve clicked word
put getInstanceList1item (clickedLine) into instanceNum
if instanceNum is empty then
beep
answer "Sorry, nothing to retrieve!"
exit to HyperCard
end if
setInstanceNum instanceNum
put 1 into whichSubset
browseContext 1
end if
end mouseUp
-- part 4 (field)
-- low flags: 01
-- high flags: 0002
-- rect: left=0 top=104 right=189 bottom=496
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 4
-- text size: 9
-- style flags: 0
-- line height: 12
-- part name: Context
----- HyperTalk script -----
on mouseUp
global textChunkSize, textOffset, contextLineLength
set cursor to watch
checkOpenDatabase -- make sure files are open
lock screen
put clickedLineNum() into clickedLine
put getTextPtrListPtrItem(clickedLIne) into textPtr
if textPtr < 0 then
beep
answer "Sorry, nothing to retrieve!"
exit to HyperCard
end if
hide field "SearchPattern1"
hide field "SearchPattern2"
get zbrowser ("TEXT", textPtr, textChunkSize, textOffset, getTextFileRefNum())
put number of lines of It into textItemLines
put line 1 to (textItemLines-1) of It into field "Text"
put line textItemLines of It into textLastLine
setTextStart (word 1 of textLastLine)
setTextTarget (word 2 of textLastLine)
setTextEnd (word 3 of textLastLine)
-- following handles highlighting of target word....
put getTextTarget() into startSelection
get char startSelection to startSelection+contextLineLength of field Text
put startSelection+(the length of word 1 of It)-1 into endSelection
set the scroll of field Text to 0
select char startSelection to endSelection of field Text
get the rect of field Text
-- so we can display highlighted word nicely, need to fake a page-down
put (item 3 of It) - 8 into pageDownTextX
put (item 4 of It) - 16 into pageDownTextY
click at pageDownTextX,pageDownTextY
set the lockScreen to false
select char startSelection to endSelection of field Text
end mouseUp
-- part 11 (field)
-- low flags: 80
-- high flags: 0007
-- rect: left=234 top=62 right=184 bottom=423
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 4
-- text size: 9
-- style flags: 0
-- line height: 12
-- part name: FTvars
-- part 16 (button)
-- low flags: 80
-- high flags: 0000
-- rect: left=233 top=20 right=42 bottom=255
-- title width / last selected line: 0
-- icon id / first selected line: 29513 / 29513
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: fill subset 1
----- HyperTalk script -----
on mouseUp
-- fill the subset associated with Index field #1
checkOpenDatabase
if not (getSubsetHandle(1) = 0 or getSubsetHandle(1) = empty) then
get zbrowser ("RELEASESUBSET", getSubsetHandle(1))
setSubsetHandle 1,0
end if
browseIndex1
hide field "searchPattern1"
hide bg button "and subsets"
hide bg button "or subsets"
hide bg button "not subset 1"
hide bg button "fill subset 1"
end mouseUp
-- part 17 (button)
-- low flags: 80
-- high flags: 0000
-- rect: left=233 top=40 right=62 bottom=255
-- title width / last selected line: 0
-- icon id / first selected line: 29515 / 29515
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: not subset 1
----- HyperTalk script -----
on mouseUp
-- invert the subset associated with Index field #1
checkOpenDatabase
if (getSubsetHandle(1) = 0 or getSubsetHandle(1) = empty) then
beep
answer "Sorry, subset not open!"
exit to HyperCard
else
get zbrowser ("BOOLEANNOTSUBSET", getSubsetHandle(1))
end if
browseIndex1
if the number of words in field "SearchPattern1" > 1 then
put "not (" before field "SearchPattern1"
put ")" after field "SearchPattern1"
else
put "not " before field "SearchPattern1"
end if
show field "SearchPattern1"
end mouseUp
-- part 18 (button)
-- low flags: 80
-- high flags: 0000
-- rect: left=240 top=61 right=83 bottom=271
-- title width / last selected line: 0
-- icon id / first selected line: 29518 / 29518
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: or subsets
----- HyperTalk script -----
on mouseUp
-- union (Boolean OR) subsets
checkOpenDatabase
if (getSubsetHandle(1) = 0 or getSubsetHandle(1) = empty or getSubsetHandle(2) = 0 or getSubsetHandle(2) = empty) then
beep
answer "Sorry, subset not open!"
exit to HyperCard
end if
if clickedOnLeftHalf() then
get zbrowser ("ORSUBSETS", getSubsetHandle(1), getSubsetHandle(2))
browseIndex1
if field "SearchPattern1" is empty then
put field "SearchPattern2" into field "SearchPattern1"
else
if the number of words in field "SearchPattern2" > 1 then
put " or (" & field "SearchPattern2" & ")" after field "SearchPattern1"
else
put " or " & field "SearchPattern2" after field "SearchPattern1"
end if
end if
else
get zbrowser ("ORSUBSETS", getSubsetHandle(2), getSubsetHandle(1))
browseIndex2
if field "SearchPattern2" is empty then
put field "SearchPattern1" into field "SearchPattern2"
else
if the number of words in field "SearchPattern1" > 1 then
put " or (" & field "SearchPattern1" & ")" after field "SearchPattern2"
else
put " or " & field "SearchPattern1" after field "SearchPattern2"
end if
end if
end if
end mouseUp
-- part 19 (button)
-- low flags: 80
-- high flags: 0000
-- rect: left=240 top=82 right=104 bottom=271
-- title width / last selected line: 0
-- icon id / first selected line: 29517 / 29517
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: and subsets
----- HyperTalk script -----
on mouseUp
-- intersection (Boolean AND) subsets
checkOpenDatabase
if (getSubsetHandle(1) = 0 or getSubsetHandle(1) = empty or getSubsetHandle(2) = 0 or getSubsetHandle(2) = empty) then
beep
answer "Sorry, subset not open!"
exit to HyperCard
end if
if clickedOnLeftHalf() then
get zbrowser ("ANDSUBSETS", getSubsetHandle(1), getSubsetHandle(2))
browseIndex1
if field "SearchPattern1" is not empty then
if the number of words in field "SearchPattern2" > 1 then
put " and (" & field "SearchPattern2" & ")" after field "SearchPattern1"
else
put " and " & field "SearchPattern2" after field "SearchPattern1"
end if
end if
else
get zbrowser ("ANDSUBSETS", getSubsetHandle(2), getSubsetHandle(1))
browseIndex2
if field "SearchPattern2" is not empty then
if the number of words in field "SearchPattern1" > 1 then
put " and (" & field "SearchPattern1" & ")" after field "SearchPattern2"
else
put " and " & field "SearchPattern1" after field "SearchPattern2"
end if
end if
end if
end mouseUp
-- part 21 (button)
-- low flags: 80
-- high flags: 0000
-- rect: left=257 top=20 right=42 bottom=279
-- title width / last selected line: 0
-- icon id / first selected line: 29513 / 29513
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: fill subset 2
----- HyperTalk script -----
on mouseUp
-- fill the subset associated with Index field #2
checkOpenDatabase
if not (getSubsetHandle(2) = 0 or getSubsetHandle(2) = empty) then
get zbrowser ("RELEASESUBSET", getSubsetHandle(2))
setSubsetHandle 2,0
end if
browseIndex2
hide field "searchPattern2"
hide bg button "and subsets"
hide bg button "or subsets"
hide bg button "not subset 2"
hide bg button "fill subset 2"
end mouseUp
-- part 22 (button)
-- low flags: 80
-- high flags: 0000
-- rect: left=257 top=40 right=62 bottom=279
-- title width / last selected line: 0
-- icon id / first selected line: 29515 / 29515
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: not subset 2
----- HyperTalk script -----
on mouseUp
-- invert the subset associated with Index field #2
checkOpenDatabase
if (getSubsetHandle(2) = 0 or getSubsetHandle(2) = empty) then
beep
answer "Sorry, subset not open!"
exit to HyperCard
else
get zbrowser ("BOOLEANNOTSUBSET", getSubsetHandle(2))
end if
browseIndex2
if the number of words in field "SearchPattern2" > 1 then
put "not (" before field "SearchPattern2"
put ")" after field "SearchPattern2"
else
put "not " before field "SearchPattern2"
end if
show field "SearchPattern2"
end mouseUp
-- part 29 (button)
-- low flags: 00
-- high flags: 2002
-- rect: left=216 top=88 right=104 bottom=233
-- title width / last selected line: 0
-- icon id / first selected line: 20407 / 20407
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: scrollDownIndex1
----- HyperTalk script -----
on mouseDown
global indexLines
checkOpenDatabase
if line indexLines of field Index1 is empty then
beep
exit mouseDown
end if
setWordNum1 (getWordNum1() + 1)
browseIndex1
end mouseDown
on mouseStillDown
global indexLines
if line indexLines of field Index1 is empty then
beep
exit mouseStillDown
end if
setWordNum1 (getWordNum1() + 2)
browseIndex1
end mouseStillDown
-- part 37 (button)
-- low flags: 00
-- high flags: 2002
-- rect: left=495 top=104 right=120 bottom=512
-- title width / last selected line: 0
-- icon id / first selected line: 24019 / 24019
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: scrollUpContext
----- HyperTalk script -----
on mouseDown
checkOpenDatabase
if line 1 of field Context is empty then exit mouseDown
browseContext 2
setInstanceNum getTextPtrListInstanceItem (1)
end mouseDown
on mouseStillDown
if line 1 of field Context is empty then exit mouseStillDown
browseContext 3
setInstanceNum getTextPtrListInstanceItem (1)
end mouseStillDown
-- part 42 (button)
-- low flags: 00
-- high flags: 2002
-- rect: left=496 top=142 right=158 bottom=512
-- title width / last selected line: 0
-- icon id / first selected line: 15717 / 15717
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: jumpContext
----- HyperTalk script -----
on mouseUp
checkOpenDatabase
ask "Instances (+/-) to jump?"
lock screen
setInstanceNum (It + getInstanceNum())
browseContext 1
end mouseUp
-- part 40 (button)
-- low flags: 00
-- high flags: 2002
-- rect: left=495 top=173 right=189 bottom=512
-- title width / last selected line: 0
-- icon id / first selected line: 20407 / 20407
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: scrollDownContext
----- HyperTalk script -----
on mouseDown
global contextLines
checkOpenDatabase
if line contextLines of field Context is empty then exit mouseDown
setInstanceNum getTextPtrListInstanceItem (contextLines)
browseContext contextLines-1
setInstanceNum getTextPtrListInstanceItem (1)
end mouseDown
on mouseStillDown
global contextLines
if line contextLines of field Context is empty then exit mouseStillDown
setInstanceNum getTextPtrListInstanceItem (contextLines)
browseContext contextLines-2
setInstanceNum getTextPtrListInstanceItem (1)
end mouseStillDown
-- part 41 (button)
-- low flags: 00
-- high flags: 0000
-- rect: left=333 top=0 right=20 bottom=365
-- title width / last selected line: 0
-- icon id / first selected line: 29531 / 29531
-- text alignment: 1
-- font id: 3
-- text size: 9
-- style flags: 256
-- line height: 12
-- part name: Open
----- HyperTalk script -----
on mouseUp
global indexLines
closeDatabase -- close out any open files first
get openCloseFiles ( ) -- put up dialog box to pick database
if It is empty then exit to HyperCard -- quit if user chooses 'Cancel'
if char 1 of It is "{" then -- display error msg if necessary
answer It
exit mouseUp
end if
put line 2 of It into field "database name"
set cursor to watch
lock screen
setTextFileRefNum(word 1 of It) -- store returned refNum values
setKeyFileRefNum(word 2 of It)
setPtrFileRefNum(word 3 of It)
setNeighborhoodSize 48 -- initialize neighborhood for proximity search
setSubsetHandle 1,0 -- initialize subsets to empty
setSubsetHandle 2,0
setWordNum1 (line 1 of zbrowser("LOCATE", "A", getKeyFileRefNum()))
if getWordNum1() < 0 then setWordNum1(0)
setWordNum2 (line 1 of zbrowser("LOCATE", "Z", getKeyFileRefNum()))
if getWordNum2() < 0 then setWordNum2(0)
browseIndex1 -- load index windows
browseIndex2
setInstanceNum(getInstanceList1item (1))
browseContext 1
end mouseUp
-- part 44 (button)
-- low flags: 00
-- high flags: 0000
-- rect: left=492 top=0 right=20 bottom=512
-- title width / last selected line: 0
-- icon id / first selected line: 29520 / 29520
-- text alignment: 1
-- font id: 3
-- text size: 9
-- style flags: 256
-- line height: 12
-- part name: Zoom/Shrink
----- HyperTalk script -----
on mouseUp
get the SelectedChunk
if the height of field Text < 175 then
set the rect of field Text to 0,19,512,342
else
set the rect of field Text to 0,189,512,342
end if
select It
end mouseUp
-- part 5 (field)
-- low flags: 00
-- high flags: 0007
-- rect: left=0 top=189 right=342 bottom=512
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 4
-- text size: 9
-- style flags: 0
-- line height: 12
-- part name: Text
-- part 45 (field)
-- low flags: 81
-- high flags: 0004
-- rect: left=0 top=265 right=340 bottom=233
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 4
-- text size: 9
-- style flags: 0
-- line height: 12
-- part name: SearchPattern1
----- HyperTalk script -----
on mouseUp
hide field "SearchPattern1"
end mouseUp
-- part 46 (field)
-- low flags: 81
-- high flags: 0004
-- rect: left=279 top=265 right=340 bottom=512
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 4
-- text size: 9
-- style flags: 0
-- line height: 12
-- part name: SearchPattern2
----- HyperTalk script -----
on mouseUp
hide field "SearchPattern2"
end mouseUp
-- part 47 (field)
-- low flags: 01
-- high flags: 0002
-- rect: left=19 top=1 right=16 bottom=192
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 4
-- text size: 9
-- style flags: 0
-- line height: 12
-- part name: database name
-- part 48 (button)
-- low flags: 00
-- high flags: 0000
-- rect: left=198 top=0 right=20 bottom=216
-- title width / last selected line: 0
-- icon id / first selected line: 16451 / 16451
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: find selection 1
----- HyperTalk script -----
on mouseUp
set cursor to watch
checkOpenDatabase
put word 1 of the selection into theSel
if theSel is empty then
beep
answer "Please highlight a word before clicking."
exit mouseUp
end if
setWordNum1 (line 1 of zbrowser("LOCATE", theSel, getKeyFileRefNum()))
if getWordNum1() < 0 then setWordNum1(0)
browseIndex1
if the height of field "Text" > 169 then
send mouseUp to bg button id 44
end if
end mouseUp
-- part 49 (button)
-- low flags: 00
-- high flags: 0000
-- rect: left=294 top=0 right=20 bottom=312
-- title width / last selected line: 0
-- icon id / first selected line: 16451 / 16451
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: find selection 2
----- HyperTalk script -----
on mouseUp
set cursor to watch
checkOpenDatabase
put word 1 of the selection into theSel
if theSel is empty then
beep
answer "Please highlight a word before clicking."
exit mouseUp
end if
setWordNum2 (line 1 of zbrowser("LOCATE", theSel, getKeyFileRefNum()))
if getWordNum2() < 0 then setWordNum2(0)
browseIndex2
if the height of field "Text" > 169 then
send mouseUp to bg button id 44
end if
end mouseUp
-- part 50 (button)
-- low flags: 00
-- high flags: 0000
-- rect: left=457 top=0 right=18 bottom=475
-- title width / last selected line: 0
-- icon id / first selected line: 29711 / 29711
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: move up in text
----- HyperTalk script -----
on mouseUp
global textChunkSize
set cursor to watch
checkOpenDatabase
if getTextStart() is 0 then
beep
answer "Already at beginning of database!"
exit mouseUp
end if
get zbrowser ("TEXT", getTextStart() - 1, textChunkSize, textChunkSize, getTextFileRefNum())
put number of lines of It into textItemLines
put line 1 to (textItemLines-1) of It into field "Text"
put line textItemLines of It into textLastLine
setTextStart (word 1 of textLastLine)
setTextTarget (word 2 of textLastLine)
setTextEnd (word 3 of textLastLine)
select char getTextEnd() to getTextEnd() - 1 of field "Text"
end mouseUp
-- part 51 (button)
-- low flags: 00
-- high flags: 0000
-- rect: left=474 top=0 right=18 bottom=492
-- title width / last selected line: 0
-- icon id / first selected line: 29712 / 29712
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: move down in text
----- HyperTalk script -----
on mouseUp
global textChunkSize
set cursor to watch
checkOpenDatabase
if last line of field "Text" is "{end of database}" then
beep
answer "Already at end of database!"
exit mouseUp
end if
get zbrowser ("TEXT", getTextEnd(), textChunkSize, 1, getTextFileRefNum())
put number of lines of It into textItemLines
put line 1 to (textItemLines-1) of It into field "Text"
put line textItemLines of It into textLastLine
setTextStart (word 1 of textLastLine)
setTextTarget (word 2 of textLastLine)
setTextEnd (word 3 of textLastLine)
select char 1 to 0 of field "Text"
end mouseUp
-- part 56 (button)
-- low flags: 00
-- high flags: 0000
-- rect: left=383 top=0 right=19 bottom=403
-- title width / last selected line: 0
-- icon id / first selected line: 15420 / 15420
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Prev
----- HyperTalk script -----
on mouseUp
visual effect wipe right
go to previous card
end mouseUp
-- part 57 (button)
-- low flags: 00
-- high flags: 0000
-- rect: left=404 top=0 right=19 bottom=424
-- title width / last selected line: 0
-- icon id / first selected line: 16560 / 16560
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Next
----- HyperTalk script -----
on mouseUp
visual effect wipe left
go to next card
end mouseUp
-- part 59 (button)
-- low flags: 00
-- high flags: 0000
-- rect: left=434 top=3 right=16 bottom=448
-- title width / last selected line: 0
-- icon id / first selected line: 1018 / 1018
-- text alignment: 1
-- font id: 3
-- text size: 9
-- style flags: 0
-- line height: 12
-- part name: notes
----- HyperTalk script -----
on mouseUp
push card
go to card id 3713
end mouseUp